package com.example.aop.controller;

import com.example.aop.config.MyAspect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/test")
public class Test {
    @RequestMapping("/t1")
    public String t1(){
        log.info("执行 t1...");
        return "t1";
    }

    @MyAspect
    @RequestMapping("t2")
    public Integer t2(){
        log.info("执行 t2...");
        int result = 10 / 10;
        return result;
    }
}
